﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sahit.iSoilHotel.Domain.Seedwork;

namespace Sahit.iSoilHotel.Domain.MainBoundedContext.Tavern.Aggregates.AuthenticationAgg
{
    public class Permission:Entity
    {
        #region Members

        private ICollection<AccountRole> accountRoles;

        #endregion

        #region Properties

        public string Name { get; set; }
        public string SystemName { get; set; }
        public string Category { get; set; }
        public virtual ICollection<AccountRole> AccountRoles
        {
            get { return this.accountRoles ?? (this.accountRoles = new List<AccountRole>()); }
            set { this.accountRoles = value; }
        }
        #endregion 
        public AccountRole AddNewAccountRole(Guid accountRoleID, string accountName)
        {
            AccountRole accountRole = new AccountRole();
            accountRole.Name = accountName;
            accountRole.ChangeCurrentIdentity(accountRoleID);

            this.AccountRoles.Add(accountRole);
            return accountRole;
        }
    }
}
